import request from "../service";

//菜单列表
export function getMenuList(pageIndex = 1, pageSize = 10) {
  return request({
    url: `/system/menu/getMenuList`,
    method: "post",
    data: {
      pageIndex,
      pageSize
    }
  });
}

//添加菜单
export function setMenus(menus) {
  return request({
    url: `/system/menu/addMenu`,
    method: "post",
    data: {
      menus
    }
  });
}

//更新菜单
export function updateMenus(menus) {
  return request({
    url: `/system/menu/updateMenu`,
    method: "post",
    data: {
      menus
    }
  });
}

//删除菜单
export function delMenus(id) {
  return request({
    url: `/system/menu/deleteMenu`,
    method: "post",
    data: {
      id
    }
  });
}

//角色列表
export function getRoleList(pageIndex = 1, pageSize = 10) {
  return request({
    url: `/system/role/getRoleList`,
    method: "post",
    data: {
      pageIndex, pageSize
    }
  });
}

//添加角色
export function setRoles(roles) {
  return request({
    url: `/system/role/addRole`,
    method: "post",
    data: {
      roles
    }
  });
}

//更新角色
export function updateRoles(roles) {
  return request({
    url: `/system/role/updateRole`,
    method: "post",
    data: {
      roles
    }
  });
}

//删除角色
export function delRoles(id) {
  return request({
    url: `/system/role/deleteRole`,
    method: "post",
    data: {
      id
    }
  });
}